<template>
    <div>
        <div class="content">
            <Card class="c-card">
                <p slot="title">销售额</p>
                <Tag color="blue" slot="extra">月</Tag>
                <div class="num">￥{{monthPrice}}</div>
                <div class="card-footer">
                    <p>总销售额</p>
                    <p>{{price}}</p>
                </div>
            </Card>
            <Card class="c-card">
                <p slot="title">订单量</p>
                <Tag color="red" slot="extra">周</Tag>
                <div class="num">{{weekCount}}</div>
            </Card>
        </div>
    </div>
</template>
<script>
import { getHomePageStatisticVo } from "@/api/index"
export default {
    data() {
        return {
            price: '',
            monthPrice: '',
            weekCount: ''
        }
    },
    created() {
        let accessToken = this.getStore("accessToken")
        getHomePageStatisticVo().then(res => {
            if (res.success) {
                let resultData = res.result
                this.price = resultData.price
                this.monthPrice = resultData.monthPrice
                this.weekCount = resultData.weekCount
            }
        })
    },
    methods: {
        
    }
}
</script>
<style lang="less" scoped>
    .content{
        display: flex;
        flex-wrap: wrap;
        /deep/.c-card{
            width: 380px;
            margin-right: 25px;
            .num{
                font-size: 40px;
                margin-bottom: 20px;
            }
            .card-footer{
                display: flex;
                justify-content: space-between;
                border-top: 1px solid #e8eaec;
                padding-top: 10px;
            }
        }
    }
</style>